<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        p{width: 100%;float: left;margin: 0;}
        p>span{width: 200px;float: left;}
    </style>
</head>
<body>
    <div id="app">
        {{myname}}
        <input type="text" v-model="myname">
        <p><span>变量</span><span>{{message}}</span></p>
        <p><span>表达式</span><span>{{10+5}}</span></p>
        <p><span>三目运算符</span><span>{{message.length>3?'正确':'错误'}}</span></p>
        <p><span>函数</span><span>{{getNum}}</span></p>
        <p><span>匿名函数</span><span>{{(x)=>x+100(20)}}</span></p>
        <p><span>对象</span><span>{{ {age:18} }}</span></p>
        <p><span>函数对象</span><span>{{getNum}}</span></p>
        <p><span>html代码</span><span>{{'<a href="#">湖南网职</a>'}}</span></p>
        <p><span>html1变量</span><span>{{html}}</span></p>
        <p><span>html变量</span><span v-html='html'></span></p>
        <p><span>html变量</span><span v-html='getHtml()'></span></p>
    </div>
</body>
</html>
<script src="./vue.js"></script>
<script>
    var vm=new Vue({
        el:'#app',
        data(){
            return{
                myname:'老李',
                message:'喜欢西瓜',
                html:'<a href="#">湖南开放大学</a>',
                fruits:[],
                user:{}
            }
        },
        methods:{
            getNum:function(){
                return "19级移动二班"
            },
            getHtml(){
                let html='<a href="#">湖南开发大学</a>'
                return `你看到的是：${html}`
            }
        }
    })
</script>